import React, { Component } from 'react';
import Header from './Header'
import HeaderExtr from './HeaderExtr'


export default class NavBar extends Component{

    constructor(props) {
        super(props);
    }

    render() {
        let {headerType,leftButton,title,rightButton,leftButtonFunc,rightButtonFunc,rightButtonType,backgroundColor,rightButtonImage,rightButtonImageStyle,leftButtonImageStyle,
            logined,location,btnText,rightButtonFuncMsg,rightButtonFuncMore,listenImg,listenImgClickFunc,listenImgStyle,hasLeftImage,titleImage,titleFontSize,borderBottomColor,
            color,fontFamily,buttonFontSize,headerStyle,onLayout,disabled,leftButtonImage,titleParams,rightButtonColor,leftButtonStyle,   rightImgText,listenImgText,LeftImgText
            
            }=this.props
        let headerProps= {
            hasLeftImage:hasLeftImage,
            leftButton: leftButton,
            title: title,
            rightButton:rightButton,
            leftButtonFunc:leftButtonFunc,
            rightButtonFunc:rightButtonFunc,
            rightButtonType:rightButtonType,
            backgroundColor:backgroundColor,
            rightButtonImage:rightButtonImage,
            rightButtonImageStyle:rightButtonImageStyle,
            listenImg:listenImg,
            listenImgClickFunc:listenImgClickFunc,
            listenImgStyle:listenImgStyle,
            titleImage:titleImage,
            titleFontSize:titleFontSize,
            borderBottomColor:borderBottomColor,
            color:color,
            rightButtonColor:rightButtonColor,
            fontFamily:fontFamily,
            buttonFontSize:buttonFontSize,
            headerStyle:headerStyle,
            onLayout:onLayout,
            disabled:disabled,
            leftButtonImage:leftButtonImage,
            leftButtonImageStyle:leftButtonImageStyle,
            titleParams:titleParams,
            leftButtonStyle:leftButtonStyle,
            rightImgText:rightImgText,
            listenImgText:listenImgText,
            LeftImgText:LeftImgText
        };
        let headerExtrProps={
            logined:logined,
            location:location,
            leftButtonFunc:leftButtonFunc,
            btnText:btnText,
            rightButtonFuncMsg:rightButtonFuncMsg,
            rightButtonFuncMore:rightButtonFuncMore,
            rightImgText:rightImgText,
            listenImgText:listenImgText,
        };
        if(headerType=='header'){
            return(
                <Header {...headerProps}/>
            )
        }else{
            return (
                <HeaderExtr {...headerExtrProps}/>
            );

        }
    }
}
